package com.sky.mapper;

import com.sky.entity.MeetingRoom;
import com.sky.entity.Payment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PaymentMapper {


    /**
     * 插入数据
     * @param payment
     */
    void insert(Payment payment);


    /**
     * 修改订单状态
     * @param payment
     */
    void update(Payment payment);

    /**
     * 获取该订单信息
     * @param id
     * @return
     */
    @Select("select * from payment where id=#{id}")
    Payment getById(Long id);

    /**
     * 根据订单id获取支付信息
     * @param orderId
     * @return
     */
    @Select("select * from payment where order_id=#{orderId}")
    Payment getByOrderId(Long orderId);

    /**
     * 将那些超时的订单给设为已取消
     * @param userId
     */
    void updateOutTimeOrders(Long userId);
}
